void main(List<String> args) {
  Man man = new Man('Jack', 20);
  man.say();
  man.drive();
  man.sing();

  Women women = new Women('Rose', 18);
  women.say();
  women.dreesUp();
  women.sing();
  women.dance();

  Dancer dancer = new Dancer('Tom', 22);
  dancer.say();
  dancer.dance();
}

class Person {
  String? name;
  int? age;

  Person(String name, int age) {
    this.name = name;
    this.age = age;
  }

  say() {
    print('我叫$name，今年$age');
  }
}

class Man extends Person with SingMixin {
  Man(super.name, super.age);

  drive() {
    print('我会开车');
  }
}

class Women extends Person with SingMixin, DanceMixin {
  Women(super.name, super.age);

  dreesUp() {
    print('我会打扮');
  }
}

class Dancer extends Person with DanceMixin {
  Dancer(super.name, super.age);
}

// 1. 角色Dancer  舞蹈演员，擅长跳舞
// 2. 角色Man  男人，擅长唱歌
// 3. 角色Women  女人，擅长跳舞+唱歌
mixin SingMixin {
  sing() {
    print('我会唱歌');
  }
}

mixin DanceMixin {
  dance() {
    print("我会跳舞");
  }
}
